
import { createReactive } from '../../libs/reactive.js';

// 视图
const template = `
  <ul class="list">
    <h1>{{ title }}</h1>
    {{ dateTime }}
    <for data="list" tag="li" class="item">
      <span>姓名: { name }</span>
      <span>年龄: { age }</span>
    </for>
  </ul>
`;

function TestA() {
  const state = createReactive({
    title: '学生信息表',
    dateTime: '2021-12-28 11:07',
    list: [
      {
        id: 1,
        name: '小明',
        age: 16
      },
      {
        id: 2,
        name: '小华',
        age: 17
      },
      {
        id: 3,
        name: '小红',
        age: 15
      }
    ]
  })

  return [ template, state ];
}

export default TestA;
